import React from 'react'
import { Navigate } from 'react-router-dom';

export default function Redirect(props) {
let {comp,path} = props;
// 判断是否有token 有则已登陆
let token = localStorage.getItem('token')
return token?comp:<Navigate to={`/login?path=${path}`}></Navigate>
}
